/*!
 * <Real chromosome implemetation>
 * 
 * Copyright (c) 2008 by <Quang Huy/ NTU>
 */
#ifndef _Chromosome_Real_H_
#define _Chromosome_Real_H_


#include "Chromosome.h"
#include "../Global.h"


/*!
 * \brief
 * Implement a real-coded chromosome
 *  
 * \see
 * Chromosome | Chromosome_Binary
 */
class Chromosome_Real: public Chromosome<double>{

public:
	Chromosome_Real(const unsigned int nDimension, vector<double> lowerBounds, vector<double> upperBounds);
	
		
	virtual void fromDoubleVector(vector<double>& phenotype);
	virtual vector<double> toDoubleVector();

	/*!
	 * \brief
	 * Clone function
	 * 
	 * \returns
	 * A "twin" of the current chromosome	 
	 * 	 
	 * 	 	
	 */
	virtual Chromosome_Real* clone()
	{
		Chromosome_Real* ch = new Chromosome_Real(*this);
		return ch;
	}
private:	
	
};



/*!
 * \brief
 * Implement a real encoding chromosome
 * 
 * \param nDimension
 * Number of optimization(search) variables
 * 
 * \param lowerBounds
 * Vector of lower bound values
 * 
 * \param upperBounds
 * Vector of upper bound values
 *    
 * \remarks
 * Widely used
 * 
 * \see
 * Chromosome<T> | Chromosome_Binary
 */
Chromosome_Real::Chromosome_Real(const unsigned int nDimension, vector<double> lowerBounds, vector<double> upperBounds):Chromosome<double>(nDimension, lowerBounds, upperBounds)
{
}

/*!
 * \brief
 * Not used. The chromosome is a vector of doubles itself 
 * 
 */
void Chromosome_Real::fromDoubleVector(vector<double>& phenotype)
{
	this->assign(phenotype.begin(), phenotype.end());
}

/*!
 * \brief
 * Not used. The chromosome is a vector of doubles itself
 *  
 *  
 */
vector<double> Chromosome_Real::toDoubleVector()
{	
	return *this;
}


#endif
